package eg.com.itiga.business.role;

import eg.com.itiga.business.base.BaseServiceImpl;
import eg.com.itiga.business.exception.BusinessException;
import eg.com.itiga.domain.Role;
import eg.com.itiga.repository.exception.DataException;
import eg.com.itiga.repository.factory.RepositoryFactory;
import eg.com.itiga.repository.role.RoleDao;
import eg.com.itiga.repositoryimpl.base.BaseDaoImpl;

public class RoleServiceImpl extends BaseServiceImpl implements RoleService{

	
	public Role getRoleByName(String name) throws BusinessException {
		RoleDao roleDao=null;
		try {
			roleDao=RepositoryFactory.createRoleDao();
			roleDao.beginTransaction();
			Role r =roleDao.getRoleByName(name);
			roleDao.commit();
			return r;
		} catch (DataException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}


}
